<?php

/**
 * @Author: Wang Chunsheng 2192138785@qq.com
 * @Date:   2020-03-27 12:34:22
 * @Last Modified by:   Wang Chunsheng 2192138785@qq.com
 * @Last Modified time: 2020-04-12 12:53:24
 */


namespace common\services\common;

use Yii;
use common\services\BaseService;
use diandi\admin\models\Bloc as ModelsBloc;

/**
 * 全局服务
 * @package common\services\backend
 * @author chunchun <2192138785@qq.com>
 */
class GlobalsService extends BaseService
{
    // 集团id
    private $bloc_id = 1;
    // 子公司id
    private $store_id = 1;

    public function initId($bloc_id, $store_id)
    {
        $this->setbloc_id($bloc_id);
        $this->setStore_id($store_id);
    }

    // 全局设置商家id
    public function setbloc_id($id)
    {
        $this->bloc_id = $id;
    }

    // 全局设置商家id
    public function getbloc_id()
    {
        return $this->bloc_id;
    }



    // 全局设置子公司id
    public function setStore_id($id)
    {
        $this->store_id = $id;
    }

    // 全局获取子公司id
    public function getStore_id()
    {
        return $this->store_id;
    }

    public function getBlocAll()
    {
        return  ModelsBloc::find()->where(['status' => 1])->asArray()->all();
    }
}
